<?xml version="1.0" encoding="iso-8859-1"?>

<!-- 
  -- Please see the readme.txt file included with this distribution for 
  -- attribution and copyright information.
  -->

<root version="2.0">
	<windowclass name="reference_skillchallengeitem">
		<sizelimits>
			<minimum>
				<height>20</height>
			</minimum>
		</sizelimits>
		<sheetdata>
			<numberfield name="myfilter">
				<invisible />
				<bounds>5,0,20,20</bounds>
			</numberfield>

			<stringfield name="name">
				<bounds>0,2,200,15</bounds>
				<font>statblock-b-med</font>
				<script> 
					function onClickDown(button, x, y)
						window.text.setVisible(not window.text.isVisible());
					end
				</script>
			</stringfield>
			<jpgnumberfield name="numberdata">
				<anchored>
					<left>
						<parent>name</parent>
						<anchor>right</anchor>
						<offset>15</offset>
					</left>
					<top>
						<parent>name</parent>
						<anchor>top</anchor>
					</top>
					<size>
						<width>50</width>
						<height>16</height>
					</size>
				</anchored>
				<font>statblock-r-med</font>
				<hideonvalue>0</hideonvalue>
			</jpgnumberfield>
			<stringfield name="text">
				<anchored>
					<top>
						<anchor>bottom</anchor>
						<parent>name</parent>
					</top>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
				</anchored>
				<multilinespacing>15</multilinespacing>
				<right />
				<font>statblock-r-med</font>
				<invisible />
			</stringfield>
		</sheetdata>
	</windowclass>

	<windowclass name="skillchallenge_description">
		<sheetdata>
			<!-- DESCRIPTION -->
			<spacercontrol name="spacer">
				<height>0</height>
			</spacercontrol>
			<stringcontrol name="flavorlab">
				<anchored>
					<top>
						<anchor>bottom</anchor>
						<parent>spacer</parent>
						<relation>relative</relation>
					</top>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
				</anchored>
				<font>statblock-b-med</font>
				<static>Flavor</static>
				<selectioncolor>#FFD296</selectioncolor>
				<script> 
					function onClickDown(button, x, y)
						window.flavor.setVisible(not window.flavor.isVisible());
					end
				</script>
			</stringcontrol>
			<stringfield name="flavor">
				<anchored>
					<top>
						<anchor>bottom</anchor>
						<parent>spacer</parent>
						<relation>relative</relation>
					</top>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
				</anchored>
				<multilinespacing>15</multilinespacing>
				<font>statblock-i-med</font>
				<selectioncolor>#FFD296</selectioncolor>
				<invisible />
			</stringfield>
			<stringcontrol name="detaillab">
				<anchored>
					<top>
						<anchor>bottom</anchor>
						<parent>spacer</parent>
						<relation>relative</relation>
					</top>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
				</anchored>
				<font>statblock-b-med</font>
				<static>Details</static>
				<selectioncolor>#FFD296</selectioncolor>
				<script> 
					function onClickDown(button, x, y)
						window.details.setVisible(not window.details.isVisible());
					end
				</script>
			</stringcontrol>
			<stringfield name="details">
				<anchored>
					<top>
						<anchor>bottom</anchor>
						<parent>spacer</parent>
						<relation>relative</relation>
					</top>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
				</anchored>
				<multilinespacing>15</multilinespacing>
				<font>statblock-r-med</font>
				<selectioncolor>#FFD296</selectioncolor>
				<invisible />
			</stringfield>

			<windowlist name="itemlist">
				<anchored>
					<top>
						<anchor>bottom</anchor>
						<parent>spacer</parent>
						<relation>relative</relation>
					</top>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
				</anchored>
				<datasource>.items</datasource>
				<class>reference_skillchallengeitem</class>
				<noscroll />
				<script file="scripts/reference_list.lua" />
			</windowlist>
		</sheetdata>
	</windowclass>

	<windowclass name="reference_skillchallenge">
		<frame>controlarea</frame>
		<placement>
			<size>
				<width>340</width>
				<height>410</height>
			</size>
		</placement>
		<sizelimits>
			<minimum>
				<width>350</width>
				<height>410</height>
			</minimum>
			<dynamic />
		</sizelimits>
		<minimize>minimized_utility</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<genericcontrol name="scheader">
				<anchored>
					<top>
						<anchor>top</anchor>
						<offset>1</offset>
					</top>
					<right>
						<anchor>right</anchor>
						<offset>-1</offset>
					</right>
					<bottom>
						<anchor>bottom</anchor>
						<offset>-1</offset>
					</bottom>
					<left>
						<anchor>left</anchor>
						<offset>1</offset>
					</left>

				</anchored>
				<script>
					function onInit()
						window.scheader.setFrame("challengeframe")
					end
				</script>
			</genericcontrol>

			<stringfield name="level">
				<anchored>
					<top>
						<anchor>top</anchor>
						<offset>9</offset>
					</top>
					<right>
						<anchor>right</anchor>
						<offset>-40</offset>
					</right>
				</anchored>
				<font>statblock-b-large</font>
				<color>ffffffff</color>
			</stringfield>

			<stringcontrol name="levellab">
				<anchored>
					<top>
						<anchor>top</anchor>
						<offset>9</offset>
					</top>
					<right>
						<parent>level</parent>
						<anchor>left</anchor>
						<offset>-15</offset>
					</right>
				</anchored>
				<static>Level</static>
				<font>statblock-b-large</font>
				<color>ffffffff</color>
			</stringcontrol>

			<!-- NAME -->
			<stringfield name="name">
				<anchored>
					<top>
						<anchor>top</anchor>
						<offset>9</offset>
					</top>
					<left>
						<anchor>left</anchor>
						<offset>15</offset>
					</left>
					<right>
						<parent>levellab</parent>
						<anchor>right</anchor>
						<offset>-15</offset>
					</right>
				</anchored>
				<empty>&#171; New Personality &#187;</empty>
				<font>statblock-b-large</font>
				<color>ffffffff</color>
				<multilinespacing>15</multilinespacing>
			</stringfield>

			<stringfield name="xp">
				<anchored>
					<top>
						<parent>name</parent>
						<anchor>bottom</anchor>
						<offset>5</offset>
					</top>
					<right>
						<anchor>right</anchor>
						<offset>-10</offset>
					</right>
				</anchored>
				<font>statblock-r-med</font>
				<color>ffffffff</color>
			</stringfield>

			<stringcontrol name="XPlab">
				<anchored>
					<top>
						<parent>name</parent>
						<anchor>bottom</anchor>
						<offset>5</offset>
					</top>
					<right>
						<parent>xp</parent>
						<anchor>left</anchor>
						<offset>-15</offset>
					</right>
				</anchored>
				<static>XP</static>
				<font>statblock-r-med</font>
				<color>ffffffff</color>
			</stringcontrol>

			<stringcontrol name="SClab">
				<anchored>
					<top>
						<parent>name</parent>
						<anchor>bottom</anchor>
						<offset>5</offset>
					</top>
					<right>
						<parent>XPlab</parent>
						<anchor>left</anchor>
						<offset>-15</offset>
					</right>
					<left>
						<anchor>left</anchor>
						<offset>15</offset>
					</left>
				</anchored>
				<static>Skill Challenge</static>
				<font>statblock-r-med</font>
				<color>ffffffff</color>
			</stringcontrol>

			<genericcontrol name="tabcontentframe">
				<anchored>
					<top>
						<parent>SClab</parent>
						<anchor>bottom</anchor>
						<offset>5</offset>
					</top>
					<right>
						<anchor>right</anchor>
						<offset>-1</offset>
					</right>
					<left>
						<anchor>left</anchor>
						<offset>1</offset>
					</left>
					<bottom>
						<anchor>bottom</anchor>
						<offset>-1</offset>
					</bottom>
				</anchored>
				<frame>
					<name>white</name>
				</frame>
			</genericcontrol>

			<!-- SUBWINDOWS -->
			<subwindow name="description">
				<anchored>
					<top>
						<parent>SClab</parent>
						<anchor>bottom</anchor>
						<offset>7</offset>
					</top>
					<right>
						<anchor>right</anchor>
						<offset>-10</offset>
					</right>
					<left>
						<anchor>left</anchor>
						<offset>10</offset>
					</left>
					<bottom>
						<anchor>bottom</anchor>
						<offset>-35</offset>
					</bottom>
				</anchored>
				<activate />
				<class>skillchallenge_description</class>
			</subwindow>

			<scrollercontrol name="description_scroller">
				<anchored>
					<top>
						<anchor>bottom</anchor>
						<offset>-40</offset>
					</top>
					<bottom>
						<anchor>bottom</anchor>
						<offset>-10</offset>
					</bottom>
					<left>
						<anchor>right</anchor>
						<offset>-50</offset>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
				</anchored>
				<target>description</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
			<buttoncontrol name="add">
				<anchored>
					<top>
						<anchor>bottom</anchor>
						<offset>-25</offset>
					</top>
					<bottom>
						<anchor>bottom</anchor>
						<offset>-5</offset>
					</bottom>
					<left>
						<anchor>left</anchor>
						<offset>25</offset>
					</left>
					<right>
						<anchor>left</anchor>
						<offset>35</offset>
					</right>
				</anchored>
				<icon>
					<normal>button_ctnextactor</normal>
					<pressed>button_ctnextactor_down</pressed>
				</icon>
				<tooltip>
					<text>Add skills to Skill Challenge Tracker</text>
				</tooltip>
				<script>
					function onButtonPress()
						if User.isHost() then
							local skilllist = window.getDatabaseNode().getChild("items");
							if skilllist then
								for k,v in pairs(skilllist.getChildren()) do
									local n = NodeManager.get(v, "name", 0);
									local dc = NodeManager.get(v, "numberdata", 0);
									SkillChallengeManager.addDC(n, dc);
								end
							end
						end
					end
				</script>
			</buttoncontrol>
			
			<closebutton />
		</sheetdata>
	</windowclass>
</root>
